/*B. Arpa’s obvious problem and Mehrdad’s terrible solution
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
There are some beautiful girls in Arpa’s land as mentioned before.

Once Arpa came up with an obvious problem:

Given an array and a number x, count the number of pairs of indices i, j (1 ≤ i < j ≤ n) such that , where  is bitwise xor operation (see notes for explanation).


Immediately, Mehrdad discovered a terrible solution that nobody trusted. Now Arpa needs your help to implement the solution to that problem.

Input
First line contains two integers n and x (1 ≤ n ≤ 105, 0 ≤ x ≤ 105) — the number of elements in the array and the integer x.

Second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 105) — the elements of the array.

Output
Print a single integer: the answer to the problem.*/

#include<stdio.h>
int a[100005];
long long int b[10000005] = { 0 };
int main() {
	int n, x;
	long long int sum = 0;
	scanf_s("%d%d",&n, &x);
	for (int i = 0; i < n; i++) {
		scanf_s("%d", &a[i]);
		b[a[i] ^ x]++;
	}
	if (x == 0) {
		for (int i = 0; i < n; i++) {
			sum += b[a[i]] - 1;
		}
	}
	else {
		for (int i = 0; i < n; i++) {
			sum += b[a[i]];
		}
	}
	sum /= 2;
	printf("%I64d", sum);
	return 0;

}